\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{verbatim}
\usepackage{color}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{ctex}
\usepackage{dsfont}
\usepackage{url} 
\usepackage{bm}
\usepackage{multicol}
\usepackage{fancyvrb}

\usepackage{array}
\usepackage{blkarray}
\usepackage{tikz}

\usetikzlibrary{graphs}
\usetikzlibrary {shapes.geometric} 
\usetikzlibrary{arrows.meta}

%you should use package setspace for the vertical spacing. 
%The distance between two equations is set by the short skips!
\usepackage{setspace}%\onehalfspacing
\AtBeginDocument{%
  \addtolength\abovedisplayskip{-0.5\baselineskip}%
  \addtolength\belowdisplayskip{-0.3\baselineskip}%
%  \addtolength\abovedisplayshortskip{-0.5\baselineskip}%
%  \addtolength\belowdisplayshortskip{-0.5\baselineskip}%
}

%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%Global Background must be put in preamble
%\usebackgroundtemplate%
%{%
%    \includegraphics[width=\paperwidth,height=\paperheight]{pic/mars-pathfinder-2.jpg}%
%}

%\setCJKmainfont{Songti SC}

%\defaultfontfeatures{Mapping=tex-text}
%\setromanfont[Mapping=tex-text]{Hoefler Text}
%\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
%\setmonofont[Scale=MatchLowercase]{Andale Mono}
%\setmainfont{Kai}

\defaultfontfeatures{Mapping=tex-text}
%\setromanfont{Heiti SC} %设置中文字体
%\setromanfont{Songti SC} %设置中文字体
\setromanfont{Songti TC Bold} %设置中文字体
\XeTeXlinebreaklocale “zh”
\XeTeXlinebreakskip = 0pt plus 0pt minus 0.1pt %文章内中文自动换行，可以自行调节

%\newfontfamily{\H}{Songti SC} %设定新的字体快捷命令
%\newfontfamily{\H}{Heiti SC} %设定新的字体快捷命令
%\newfontfamily{\E}{Weibei SC} %设定新的字体快捷命令

\newenvironment{myenumerate}{
\begin{enumerate}
  \setlength{\itemsep}{2pt}
  \setlength{\parskip}{2pt}
  \setlength{\parsep}{2pt}
}{\end{enumerate}}

%creating your own itemizing environment 
\newenvironment{myitemize}
{\begin{itemize}
  \setlength{\itemsep}{2pt}
  \setlength{\parskip}{2pt}
  \setlength{\parsep}{2pt}}
{\end{itemize}} 
